package com.mall.dubbo.api;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mall.dubbo.mapper.CmsPrefrenceAreaProductRelationMapper;
import com.mall.model.domain.CmsPrefrenceAreaProductRelation;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 * @author xyiaao
 * @description 针对表【cms_prefrence_area_product_relation(优选专区和产品关系表)】的数据库操作Api实现
 * @createDate 2022-03-29 19:46:09
 */
@DubboService
public class CmsPrefrenceAreaProductRelationApiImpl extends ServiceImpl<CmsPrefrenceAreaProductRelationMapper, CmsPrefrenceAreaProductRelation>
        implements CmsPrefrenceAreaProductRelationApi {

    @Autowired
    private CmsPrefrenceAreaProductRelationMapper prefrenceAreaProductRelationMapper;

    @Override
    public List<CmsPrefrenceAreaProductRelation> findByProductId(Integer id) {

        LambdaQueryWrapper<CmsPrefrenceAreaProductRelation> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(CmsPrefrenceAreaProductRelation::getProductId, id);
        List<CmsPrefrenceAreaProductRelation> cmsPrefrenceAreaProductRelations = prefrenceAreaProductRelationMapper.selectList(queryWrapper);
        return cmsPrefrenceAreaProductRelations;
    }

}




